<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.js"></script>
</head>
<!-- 条件渲染 v-if -->
<body>
    <div id="app">
        <div v-if="n===1">张三</div>
        <div v-else-if="n===2">李四</div>
        <div v-else-if="n===3">王五</div>
        <div v-else>匿名</div>
        <button @click="n++">显示</button>
    </div>

    <script>
        new Vue({
            el: '#app',
            data: {
                n:0
            },
            methods: {

            }
        })
    </script>
</body>

</html>